Optimal. Leaf size=60 \[ \frac {e^{2 i a}}{x \left (e^{2 i a}+x^2\right )}+\frac {3 x}{e^{2 i a}+x^2}+2 e^{-i a} \text {ArcTan}\left (e^{-i a} x\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 60, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {4591, 456, 473,
393, 209} \begin {gather*} 2 e^{-i a} \text {ArcTan}\left (e^{-i a} x\right )+\frac {3 x}{x^2+e^{2 i a}}+\frac {e^{2 i a}}{x \left (x^2+e^{2 i a}\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 393
Rule 456
Rule 473
Rule 4591
Rubi steps
\begin {align*} \int \frac {\tan ^2(a+i \log (x))}{x^2} \, dx &=\int \frac {\tan ^2(a+i \log (x))}{x^2} \, dx\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.12, size = 72, normalized size = 1.20 \begin {gather*} \frac {1}{x}+2 \text {ArcTan}(x (\cos (a)-i \sin (a))) \cos (a)-2 i \text {ArcTan}(x (\cos (a)-i \sin (a))) \sin (a)+\frac {2 x (\cos (a)-i \sin (a))}{\left (1+x^2\right ) \cos (a)-i \left (-1+x^2\right ) \sin (a)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.05, size = 38, normalized size = 0.63
method | result | size |
risch | \(\frac {1}{x}+\frac {2}{x \left (1+\frac {{\mathrm e}^{2 i a}}{x^{2}}\right )}+2 \arctan \left (x \,{\mathrm e}^{-i a}\right ) {\mathrm e}^{-i a}\) | \(38\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Both result and optimal contain complex but leaf count of result is larger than
twice the leaf count of optimal. 223 vs. \(2 (45) = 90\).
time = 0.55, size = 223, normalized size = 3.72 \begin {gather*} \frac {6 \, x^{2} - 2 \, {\left (x^{3} {\left (\cos \left (a\right ) - i \, \sin \left (a\right )\right )} + {\left ({\left (\cos \left (a\right ) - i \, \sin \left (a\right )\right )} \cos \left (2 \, a\right ) + {\left (i \, \cos \left (a\right ) + \sin \left (a\right )\right )} \sin \left (2 \, a\right )\right )} x\right )} \arctan \left (\frac {2 \, x \cos \left (a\right )}{x^{2} + \cos \left (a\right )^{2} - 2 \, x \sin \left (a\right ) + \sin \left (a\right )^{2}}, \frac {x^{2} - \cos \left (a\right )^{2} - \sin \left (a\right )^{2}}{x^{2} + \cos \left (a\right )^{2} - 2 \, x \sin \left (a\right ) + \sin \left (a\right )^{2}}\right ) + {\left (x^{3} {\left (-i \, \cos \left (a\right ) - \sin \left (a\right )\right )} + {\left ({\left (-i \, \cos \left (a\right ) - \sin \left (a\right )\right )} \cos \left (2 \, a\right ) + {\left (\cos \left (a\right ) - i \, \sin \left (a\right )\right )} \sin \left (2 \, a\right )\right )} x\right )} \log \left (\frac {x^{2} + \cos \left (a\right )^{2} + 2 \, x \sin \left (a\right ) + \sin \left (a\right )^{2}}{x^{2} + \cos \left (a\right )^{2} - 2 \, x \sin \left (a\right ) + \sin \left (a\right )^{2}}\right ) + 2 \, \cos \left (2 \, a\right ) + 2 i \, \sin \left (2 \, a\right )}{2 \, {\left (x^{3} + x {\left (\cos \left (2 \, a\right ) + i \, \sin \left (2 \, a\right )\right )}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.27, size = 78, normalized size = 1.30 \begin {gather*} \frac {3 \, x^{2} e^{\left (i \, a\right )} + {\left (i \, x^{3} + i \, x e^{\left (2 i \, a\right )}\right )} \log \left (x + i \, e^{\left (i \, a\right )}\right ) + {\left (-i \, x^{3} - i \, x e^{\left (2 i \, a\right )}\right )} \log \left (x - i \, e^{\left (i \, a\right )}\right ) + e^{\left (3 i \, a\right )}}{x^{3} e^{\left (i \, a\right )} + x e^{\left (3 i \, a\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.30, size = 54, normalized size = 0.90 \begin {gather*} - \frac {- 3 x^{2} - e^{2 i a}}{x^{3} + x e^{2 i a}} - \left (i \log {\left (x - i e^{i a} \right )} - i \log {\left (x + i e^{i a} \right )}\right ) e^{- i a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.55, size = 73, normalized size = 1.22 \begin {gather*} 2 \, {\left (\arctan \left (x e^{\left (-i \, a\right )}\right ) e^{\left (-3 i \, a\right )} + \frac {x e^{\left (-2 i \, a\right )}}{x^{2} + e^{\left (2 i \, a\right )}}\right )} e^{\left (2 i \, a\right )} + \frac {5}{x {\left (\frac {e^{\left (2 i \, a\right )}}{x^{2}} + 1\right )}} + \frac {e^{\left (2 i \, a\right )}}{x^{3} {\left (\frac {e^{\left (2 i \, a\right )}}{x^{2}} + 1\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.20, size = 45, normalized size = 0.75 \begin {gather*} \frac {2\,\mathrm {atan}\left (\frac {x}{\sqrt {{\mathrm {e}}^{a\,2{}\mathrm {i}}}}\right )}{\sqrt {{\mathrm {e}}^{a\,2{}\mathrm {i}}}}+\frac {3\,x^2+{\mathrm {e}}^{a\,2{}\mathrm {i}}}{x^3+{\mathrm {e}}^{a\,2{}\mathrm {i}}\,x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________